package com.vueperson.vueperson.t1.CreationalPattern.BuildingPattern.HookTest;


import com.vueperson.vueperson.t1.CreationalPattern.BuildingPattern.BuildActor.Actor;

public  abstract class ActorBuilder {
    protected static Actor actor=new Actor();

    public abstract void buildType();
    public abstract void buildSex();
    public abstract void buildFace();
    public abstract void buildCostume();
    public abstract void buildHairstyle();

    /**
     * 钩子方法
     */
    public boolean isBareheaded(){
        return false;
    }

    public Actor construct(){
        this.buildType();
        this.buildSex();
        this.buildFace();
        this.buildCostume();
        if (!isBareheaded()) {
            this.buildHairstyle();
        }

        return actor;
    }


}
